package ooo.reindeer.data.util;

import ooo.reindeer.data.annotation.*;
import ooo.reindeer.data.option.Endian;

import java.math.BigInteger;
import java.util.Arrays;
import java.util.List;
import java.util.Map;

@LengthField(value = "totalLength", clazz = AllTypeDataMapSteam.class, revise = 4)
public class AllTypeDataMapSteam {

    @Int32
    int totalLength;

    /**
     * 数值数据类型
     */
    @Int8
    byte int8;

    @Int8(Endian.LITTLE)
    byte int8LE;

    @UnsignedInt8
    short uint8;

    @UnsignedInt8(Endian.LITTLE)
    short uint8LE;

    @Int16
    short int16;

    @Int16(Endian.LITTLE)
    short int16LE;

    @UnsignedInt16
    int uint16;

    @UnsignedInt16(Endian.LITTLE)
    int uint16LE;

    @Int32
    int int32;

    @Int32(Endian.LITTLE)
    int int32LE;

    @UnsignedInt32
    long uint32;

    @UnsignedInt32(Endian.LITTLE)
    long uint32LE;

    @Int64
    long int64;

    @Int64(Endian.LITTLE)
    long int64LE;

    @UnsignedInt64
    BigInteger uint64;

    @UnsignedInt64(Endian.LITTLE)
    BigInteger uint64LE;

    @OCTBytes(8)
    byte[] octBytes;

    @OCTString(8)
    String octString;

    @Struct
    TestData testData;

    @Stream(clazz = StreamData.class,keyFieldName = "type")
    Map<Integer,StreamData> stream;

    public int getTotalLength() {
        return totalLength;
    }

    public AllTypeDataMapSteam setTotalLength(int totalLength) {
        this.totalLength = totalLength;
        return this;
    }

    public byte getInt8() {
        return int8;
    }

    public AllTypeDataMapSteam setInt8(byte int8) {
        this.int8 = int8;
        return this;
    }

    public byte getInt8LE() {
        return int8LE;
    }

    public AllTypeDataMapSteam setInt8LE(byte int8LE) {
        this.int8LE = int8LE;
        return this;
    }

    public short getUint8() {
        return uint8;
    }

    public AllTypeDataMapSteam setUint8(short uint8) {
        this.uint8 = uint8;
        return this;
    }

    public short getUint8LE() {
        return uint8LE;
    }

    public AllTypeDataMapSteam setUint8LE(short uint8LE) {
        this.uint8LE = uint8LE;
        return this;
    }

    public short getInt16() {
        return int16;
    }

    public AllTypeDataMapSteam setInt16(short int16) {
        this.int16 = int16;
        return this;
    }

    public short getInt16LE() {
        return int16LE;
    }

    public AllTypeDataMapSteam setInt16LE(short int16LE) {
        this.int16LE = int16LE;
        return this;
    }

    public int getUint16() {
        return uint16;
    }

    public AllTypeDataMapSteam setUint16(int uint16) {
        this.uint16 = uint16;
        return this;
    }

    public int getUint16LE() {
        return uint16LE;
    }

    public AllTypeDataMapSteam setUint16LE(int uint16LE) {
        this.uint16LE = uint16LE;
        return this;
    }

    public int getInt32() {
        return int32;
    }

    public AllTypeDataMapSteam setInt32(int int32) {
        this.int32 = int32;
        return this;
    }

    public int getInt32LE() {
        return int32LE;
    }

    public AllTypeDataMapSteam setInt32LE(int int32LE) {
        this.int32LE = int32LE;
        return this;
    }

    public long getUint32() {
        return uint32;
    }

    public AllTypeDataMapSteam setUint32(long uint32) {
        this.uint32 = uint32;
        return this;
    }

    public long getUint32LE() {
        return uint32LE;
    }

    public AllTypeDataMapSteam setUint32LE(long uint32LE) {
        this.uint32LE = uint32LE;
        return this;
    }

    public long getInt64() {
        return int64;
    }

    public AllTypeDataMapSteam setInt64(long int64) {
        this.int64 = int64;
        return this;
    }

    public long getInt64LE() {
        return int64LE;
    }

    public AllTypeDataMapSteam setInt64LE(long int64LE) {
        this.int64LE = int64LE;
        return this;
    }

    public BigInteger getUint64() {
        return uint64;
    }

    public AllTypeDataMapSteam setUint64(BigInteger uint64) {
        this.uint64 = uint64;
        return this;
    }

    public BigInteger getUint64LE() {
        return uint64LE;
    }

    public AllTypeDataMapSteam setUint64LE(BigInteger uint64LE) {
        this.uint64LE = uint64LE;
        return this;
    }

    public byte[] getOctBytes() {
        return octBytes;
    }

    public AllTypeDataMapSteam setOctBytes(byte[] octBytes) {
        this.octBytes = octBytes;
        return this;
    }

    public String getOctString() {
        return octString;
    }

    public AllTypeDataMapSteam setOctString(String octString) {
        this.octString = octString;
        return this;
    }

    public TestData getTestData() {
        return testData;
    }

    public AllTypeDataMapSteam setTestData(TestData testData) {
        this.testData = testData;
        return this;
    }

    public Map<Integer, StreamData> getStream() {
        return stream;
    }

    public AllTypeDataMapSteam setStream(Map<Integer, StreamData> stream) {
        this.stream = stream;
        return this;
    }

    @Override
    public String toString() {
        return "AllTypeDataMapSteam{" +
                "totalLength=" + totalLength +
                ", int8=" + int8 +
                ", int8LE=" + int8LE +
                ", uint8=" + uint8 +
                ", uint8LE=" + uint8LE +
                ", int16=" + int16 +
                ", int16LE=" + int16LE +
                ", uint16=" + uint16 +
                ", uint16LE=" + uint16LE +
                ", int32=" + int32 +
                ", int32LE=" + int32LE +
                ", uint32=" + uint32 +
                ", uint32LE=" + uint32LE +
                ", int64=" + int64 +
                ", int64LE=" + int64LE +
                ", uint64=" + uint64 +
                ", uint64LE=" + uint64LE +
                ", octBytes=" + Arrays.toString(octBytes) +
                ", octString='" + octString + '\'' +
                ", testData=" + testData +
                ", stream=" + stream +
                '}';
    }
}
